home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8318 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  44 lines

  1. Path: ix.netcom.com!news
  2. From: richrug@ix.netcom.com(RICHARD RUGANI)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: *** Need help ASAP *** CLS, LOCATE, etc do not work with Borland 3.1 for dos
  5. Date: 3 Mar 1996 03:46:15 GMT
  6. Organization: Netcom
  7. Message-ID: <4hb4m7$b56@dfw-ixnews1.ix.netcom.com>
  8. References: <4h96ne$3nb@fountain.mindlink.net>
  9. NNTP-Posting-Host: den-co9-09.ix.netcom.com
  10. X-NETCOM-Date: Sat Mar 02  9:46:15 PM CST 1996
  11.  
  12. In <4h96ne$3nb@fountain.mindlink.net> mike_huwe@mindlink.bc.ca (Mike
  13. Huwe) writes: 
  14. >
  15. >I am using Borland C++ 3.1. When I run simple programs that clear the
  16. >screen or use the LOCATE command, they don't work. for example,
  17.  
  18. Borland C provides a function for clearing the screen, and a function
  19. for locating the cursor:
  20.  
  21.     clrscr()         clears the screen
  22.     gotoxy(x,y)      locates the cursor at column x, line y
  23.  
  24. and then there's:
  25.  
  26.     getch()          halts the program until the user strikes a key
  27.  
  28. Try this:
  29.  
  30. #include <stdio.h>
  31. #include <conio.h>
  32. int main(void)
  33. {
  34.     clrscr();                     /*  clear the screen  */
  35.     printf("This is column 1, line 1");
  36.     gotoxy(40,10);                /*  cursor at column 40, line 10  */
  37.     printf("This is column 40, line 10");
  38.     gotoxy(60,24);                /*  cursor at column 60, line 24  */ 
  39.     printf("Hit any key");
  40.     getch();                      /*  program waits for keystrike   */
  41.     return 0;
  42. }     
  43.  
  44.